<?php

namespace App\Console\Commands;

use App\Console\Crons\AdMatchMonitorCron;
use App\Console\Crons\WxMiniprogramLimitCheckCron;
use App\Datalog\AdFirstup;
use App\Models\Manager\AdToutiaoMaterial;
use App\Models\FirstupAd;
use App\Models\GameChannel;
use App\Models\Users;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Crypt;

class Test extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'yq:test';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Test专用测试';

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        $url = 'http:\/\/ocpc.baidu.com\/ocpcapi\/cb\/actionCb?a_type={{ATYPE}}&a_value={{AVALUE}}&s=1741261617&o=1608803687000&actType=2&ext_info=AFD3DAiLCJtIjoiMTYwODgwMzY4NzAwMCIsIm4iOiIxIiwibyI6IjE4NyIsInAiOiIzIiwicSI6IjIiLCJyIjoiNCIsInMiOiI3MDAiLCJ0IjoiMTUyODQ0NDg1MjUzNiIsIngiOiIxMDAxIiwieSI6IiJ90MTIiLCI2IjoiIiwiNyI6IjAiLCI5IjoiMSIsImEiOiJDMzkxQkNCOTc3MDRBNEQ4OEVGOTNBRjFDQkYwOEE3OUU5MjhDNjEzMEZNQk9ISE9ERk0iLCJjIjoiREVFUExJTksiLCJkIjoiOTk3NDEyNjkiLCJlIjoiMzc3NzIzNDI2NyIsImYiOiIxIiwiaCI6IjE3NDEyNjE2MTciLCJpIjoiNzgyIiwiaiI6IjE2NTEyIiwiayI6Ik5qTXhNVGcwTWpVPSIsImwiOiIxNzQxMjYxNjE3XzE2MDg4MDM2ODcwMeyIxNCI6IjEiLCIyMSI6IjEiLCIyNCI6IjI0IiwiMjUiOiIyIiwiMjkiOiIyIiwiMzAiOiJuMTA0cmpjWVBOdGtQMWZrbldta1BqUnMiLCIzOSI6IjAiLCI0MCI6IjAiLCI1MSI6IjE1NTMyMDg2MDE&isMock=2&token=n104rjcYPNtkP1fknWmkPjRs&tokenid=n104rjcYPNtkP1fknWmkPjRs';
        $url = preg_replace('/(&sign.*)/i', '', $url);
        dd($url);
    }

    public function pwd()
    {
        $msg = 'eyJpdiI6ImdabXJ3bEJpTTdOZXNoTjVFZTE4ZGc9PSIsInZhbHVlIjoiV09tS2pnOWJ6a0Q2NE5zci9yY0JsZz09IiwibWFjIjoiZmVjZDE2OTllOWFjMDM0MDc3Y2IwZDY5MDllZmY5ODExZTFmOWNjMjUwN2U3NTM5Zjk2YmFhM2I5OTJiMGZhYSIsInRhZyI6IiJ9';
        $pwd = Crypt::decryptString($msg);
        echo $pwd;
    }
}
